import service from '../utils/request'

//一个请求封装成一个函数
export function index_banner(payload = {}) {
    return service.get('/api/index/banner', { params: payload })
}

export function user_login(payload = {}) {
    return service.post('/api/user/login', payload)
}

export function category_list(payload = {}) {
    return service.get('/api/category/list', { params: payload })
}

export function category_subcate(payload = {}) {
    return service.get('/api/category/subcate', { params: payload })
}

//...
// 首页分类导航
// params={}没传值就是一个空对象
export function classification(params = {}) {
    return service.get('/api/index/nav', { params })
}

// 首页推荐列表区域
export function Recommend(params = {}) {
    return service.get('/api/index/goodlist', { params })
}

// 分类左侧一级
// params={}没传值就是一个空对象
export function Leftnavigationbar(params = {}) {
    return service.get('/api/category/list', { params })
}

//  二级分类列表
export function SecondaryClassification(params = {}) {
    return service.get('/api/category/subcate', { params })
}

// 所有商品按分类搜索
export function good_list(payload = {}) {
    return service.get('/api/good/list', { params: payload })
}

// 详情页
export function good_goodinfo(payload = {}) {
    return service.get('/api/good/goodinfo', { params: payload })
}





//登录
export function Signin(data) {
    return service.post('/api/user/login', data)
}

//注册
export function Zhuce(data) {
    return service.post('/api/user/register', data)
}



